package com.comcast.core.eeg.eventsubscription.service;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.comcast.core.eeg.eventsubscription.types.DeliveryOption;
import com.comcast.core.eeg.eventsubscription.types.EventSubscription;
import com.comcast.core.eeg.eventsubscription.types.RetrievalResult;
import com.comcast.core.eeg.eventsubscription.types.RetrievingResult;
import com.comcast.core.eeg.eventsubscription.types.SubscriptionOption;
import com.comcast.core.eeg.eventsubscription.types.SubscriptionResult;
import com.comcast.core.eeg.types.Participant;
import com.comcast.core.eeg.types.Result;

public class EventSubscriptionServiceImpl implements EventSubscriptionService {

    private static Log logger = LogFactory.getLog(EventSubscriptionServiceImpl.class);

    private static int DEFAULT_SUBSCRIPTION_BATCH_MAX_SIZE = 10000;

    //for EventSubscriptionService
    private String subscriptionId;
    private Subscription subscription;


    public EventSubscriptionServiceImpl() {
    }

    public SubscriptionResult subscribe(Participant participant, String subscriptionName,SubscriptionOption option) {
        if (logger.isDebugEnabled()) {
            logger.debug("EventSubscriptionServiceImpl - SubscriptionOption - TransactionOption " + option.getTransaction());
        }

        return null;
    }

    public RetrievalResult get(EventSubscription sub, DeliveryOption option) {

        return null;
    }


    public RetrievingResult retrieve(EventSubscription sub, DeliveryOption option) {
        return null;
    }

    public Result commit(EventSubscription sub) {
        return null;
    }

    public Result rollback(EventSubscription sub) {
        return null;
    }

    public void close(EventSubscription sub) {
    }

    private SubscriptionResult validateSubscribe(Participant participant, String subscriptionName,  SubscriptionOption option) {
    	return null;
    }

    private RetrievalResult validateGet(EventSubscription sub, DeliveryOption option) {
    	return null;
    }

    private RetrievingResult convertResult(RetrievalResult tmp) {
        RetrievingResult result = new RetrievingResult();
        result.setErrors(tmp.getErrors());
        result.setSucceeded(tmp.getSucceeded());
        return result;
    }
}
